package org.example.wxdemo.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.wxdemo.model.WxTemplateMessage;
import org.example.wxdemo.service.WxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/wx/template")
public class WxTemplateController {
    
    @Autowired
    private WxService wxService;
    
    @PostMapping("/send")
    public boolean sendTemplateMessage(@RequestBody WxTemplateMessage message) {
        log.info("Sending template message: {}", message);
        return wxService.sendTemplateMessage(message);
    }
} 